using System;
using System.Collections.Generic;
using System.Text;

namespace NBox.Service.Communication
{
    /// <summary>
    /// 
    /// </summary>
    /// <param name="msgSummary"></param>
    public delegate void ServiceRequestNotifyHandler(ServiceMessageSummary msgSummary);

    /// <summary>
    /// 
    /// </summary>
    public interface IServiceMQ
    {
        Guid SendMessage(ServiceMessage msg);

        ServiceMessage ReceiveMessage(Guid transactionId, bool isRequestMessage);

        void SubscribeServiceRequestMessage(string serviceName, Guid clientId, ServiceRequestNotifyHandler handler);

        void CleanExpiredMessages(out ServiceMessage[] expiredRequests, out ServiceMessage[] expiredResponses);

        void SetBroadCastStrategy(IBroadCastStrategy broadCastStrategy);
    }
}
